#include <AVUITransform.h>
#include <AVUITransformCollection.h>

namespace AVUI {

class GeneralTransformGroup : public GeneralTransform
{
public:

    GeneralTransformGroup() { };
    ~GeneralTransformGroup() { m_children.InvalidateWeakReferences(); }


    DECLARE_ELEMENT(GeneralTransformGroup, GeneralTransform);
    IMPLEMENT_READONLY_REFERENCE_PROPERTY(Children, GeneralTransformCollection, true);

    GeneralTransformCollection* get_Children() { return &m_children; }

    void CloneCore(Freezable* pSource);

    virtual Rect TransformBounds(Rect rect) AVUI_OVERRIDE;
    virtual bool TryTransform(const Point& inPoint, Point* pResult) AVUI_OVERRIDE;

    virtual TRefCountedPtr<GeneralTransform> get_Inverse() AVUI_OVERRIDE;
	virtual TRefCountedPtr<AVUI::Transform> get_AffineTransform() AVUI_OVERRIDE;

protected:

    virtual TRefCountedPtr<Freezable> CreateInstanceCore() AVUI_OVERRIDE { return object_allocate<GeneralTransformGroup>().get_Ptr(); }

private:
    GeneralTransformCollection m_children;
};

typedef TRefCountedPtr<GeneralTransformGroup> GeneralTransformGroupPtr;


}; // namespace AVUI
